__author__ = 'shawhen'

from . import WinNT
from . import Kernel32

from ...cstd import stddef


INVALID_HANDLE_VALUE = WinNT.HANDLE(-1)

def CloseHandle(hObject):
    """
    :param hObject to close object's handle
    :return BOOL
    """
    return Kernel32.Kernel32_dll.CloseHandle(hObject)


def GetModuleHandle(module_name=None):
    """
    :param module_name None <-> NULL
    :return HANDLE
    """
    if module_name is None:
        module_name = stddef.NULL
    return Kernel32.Kernel32_dll.GetModuleHandleW(module_name)